package jp.co.monex.debug_version
{
	import flash.events.EventDispatcher;
	
	import mx.collections.ArrayCollection;
	import mx.controls.Alert;
	
	public class MySingleTon extends EventDispatcher
	{
		public var mainLogText:String;
		public var debugArray:Array =  new Array();
		public var dubugArrayCollection:ArrayCollection = new ArrayCollection();
		
		public static const _instance:MySingleTon = new MySingleTon();
		
		public function MySingleTon()
		{
			if ( _instance != null ) {
				
				throw new Error( "Please use the instance property to access." );
				 }

		}
		
		public static function get instance():MySingleTon {
			return _instance;
		}
		
		public function debugLine(logVal:String, type:String):void {
			var obj:Object =  new Object
			obj.type = type;
			obj.msg = logVal;
			debugArray = new Array();
			debugArray.push(obj);
			dubugArrayCollection.addItem(obj);
			mainLogText += "\n"+logVal;
			trace( "Testing called.");
			//mx.controls.Alert.show("SingleTonTest"+mainLogText +dubugArrayCollection.length );
		}

	}
}



